﻿namespace ICMRemoteEdu.Classes
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Windows.Forms;

    public class ICMUserRegisterForm : Form
    {
        private Button btnCancel;
        private Button btnOk;
        private IContainer components;
        private Label label1;
        private Label label2;
        private Label label3;
        private MaskedTextBox tbCompany;
        private MaskedTextBox tbName;
        private MaskedTextBox tbPosition;

        public ICMUserRegisterForm()
        {
            this.InitializeComponent();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            if (this.tbCompany.Text == string.Empty)
            {
                MessageBox.Show("Заполните учреждение!");
                this.tbCompany.Focus();
            }
            else if (this.tbName.Text == string.Empty)
            {
                MessageBox.Show("Заполните ФИО!");
                this.tbName.Focus();
            }
            else if (this.tbPosition.Text == string.Empty)
            {
                MessageBox.Show("Заполните должность!");
                this.tbPosition.Focus();
            }
            else if (((this.tbPosition.Text != string.Empty) && (this.tbName.Text != string.Empty)) && (this.tbCompany.Text != string.Empty))
            {
                base.DialogResult = DialogResult.OK;
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private void InitializeComponent()
        {
            this.tbCompany = new MaskedTextBox();
            this.label1 = new Label();
            this.label2 = new Label();
            this.tbName = new MaskedTextBox();
            this.label3 = new Label();
            this.tbPosition = new MaskedTextBox();
            this.btnOk = new Button();
            this.btnCancel = new Button();
            base.SuspendLayout();
            this.tbCompany.Location = new Point(12, 30);
            this.tbCompany.Name = "tbCompany";
            this.tbCompany.Size = new Size(0x129, 20);
            this.tbCompany.TabIndex = 0;
            this.label1.AutoSize = true;
            this.label1.Location = new Point(13, 11);
            this.label1.Name = "label1";
            this.label1.Size = new Size(0x49, 13);
            this.label1.TabIndex = 1;
            this.label1.Text = "Учреждение:";
            this.label2.AutoSize = true;
            this.label2.Location = new Point(13, 0x38);
            this.label2.Name = "label2";
            this.label2.Size = new Size(0x25, 13);
            this.label2.TabIndex = 3;
            this.label2.Text = "ФИО:";
            this.tbName.Location = new Point(11, 0x48);
            this.tbName.Name = "tbName";
            this.tbName.Size = new Size(0x12a, 20);
            this.tbName.TabIndex = 2;
            this.label3.AutoSize = true;
            this.label3.Location = new Point(13, 0x6d);
            this.label3.Name = "label3";
            this.label3.Size = new Size(0x44, 13);
            this.label3.TabIndex = 5;
            this.label3.Text = "Должность:";
            this.tbPosition.Location = new Point(11, 0x7d);
            this.tbPosition.Name = "tbPosition";
            this.tbPosition.Size = new Size(0x12a, 20);
            this.tbPosition.TabIndex = 4;
            this.btnOk.Location = new Point(0x10, 0xa6);
            this.btnOk.Name = "btnOk";
            this.btnOk.Size = new Size(0x4b, 0x17);
            this.btnOk.TabIndex = 6;
            this.btnOk.Text = "Ок";
            this.btnOk.UseVisualStyleBackColor = true;
            this.btnOk.Click += new EventHandler(this.btnOk_Click);
            this.btnCancel.DialogResult = DialogResult.Cancel;
            this.btnCancel.Location = new Point(0xeb, 0xa6);
            this.btnCancel.Name = "btnCancel";
            this.btnCancel.Size = new Size(0x4b, 0x17);
            this.btnCancel.TabIndex = 7;
            this.btnCancel.Text = "Отмена";
            this.btnCancel.UseVisualStyleBackColor = true;
            base.AutoScaleDimensions = new SizeF(6f, 13f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x142, 0xca);
            base.Controls.Add(this.btnCancel);
            base.Controls.Add(this.btnOk);
            base.Controls.Add(this.label3);
            base.Controls.Add(this.tbPosition);
            base.Controls.Add(this.label2);
            base.Controls.Add(this.tbName);
            base.Controls.Add(this.label1);
            base.Controls.Add(this.tbCompany);
            base.FormBorderStyle = FormBorderStyle.FixedDialog;
            base.MaximizeBox = false;
            base.MinimizeBox = false;
            base.Name = "ICMUserRegisterForm";
            base.ShowInTaskbar = false;
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "Регистрация пользователя";
            base.ResumeLayout(false);
            base.PerformLayout();
        }

        public string Company
        {
            get
            {
                return this.tbCompany.Text;
            }
        }

        public string Position
        {
            get
            {
                return this.tbPosition.Text;
            }
        }

        public string UserName
        {
            get
            {
                return this.tbName.Text;
            }
        }
    }
}

